{{template "admin/public/head.html" .}}
<section>
	<aside>
		{{template "admin/public/nav.html" .}}
	</aside>
	<article>
		<div class="top-title">
			<dl>
				<dt><h1>{{.title}}</h1></dt>
				<dd>&nbsp;</dd>
				<dd><a href="user_chat.html"><i class="iconfont">&#xe649;</i>帮助文档</a></dd>
			</dl>
		</div>

		<div class="content">
			<div class="release">
				<dl>
					<dt><i class="iconfont">&#xe649;</i> <b>{{.title}}说明</b><br>
						<p>店铺尽量不要<mark>删除</mark>,将审核变为未审核即不在页面显示</p>
					</dt>
					<!-- <dd><a href="/admin/member/add"><button type="button" class="button">添加会员</button></a></dd> -->
				</dl>
			</div>
			<form class="form">
				<table class="table1">
					<!-- 控制表格宽度  横向合并 colspan="1"  竖向合并 rowspan="3" -->
					<thead><th width="8%"></th><th width="17%"></th><th width="8%"></th><th width="17%"></th><th width="8%"></th><th width="17%"></th><th width="8%"></th><th width="17%"></th></thead>
					<tr>
						<td class="genre">管理员</td>
						<td colspan="3">
							<input type="text" class="input70" placeholder="请输入管理员ID！" list="uid" name="uid" value="{{.info.uid}}">
							<datalist id="uid">
							</datalist>
							<button type="button" class="inputbutton" data-type="member">搜索管理员</button>
						</td>
					</tr>
					<tr>
						<td class="genre">名称</td>
						<td colspan="3"><input type="text" class="input95" placeholder="名称" value="{{.info.name}}" name="name"></td>
						<td class="genre">简称</td>
						<td><input type="text" class="input95" placeholder="简称" value="{{.info.sname}}" name="sname"></td>
					</tr>
					<tr>
						<td class="genre">所属类别</td>
						<td colspan="5">{{range .cid}}
							<label class="checkbox"><input type="checkbox" name="type" value="{{.id}}" {{if $.info.type}}{{tipcheck .id $.info.type}}{{end}}>{{.name}}</label>
							{{end}}</td>
						<td class="genre">排序</td>
						<td><input type="text" class="input70" placeholder="排序" value="{{.info.sort}}" name="sort"></td>
					</tr>
					<tr>
						<td class="genre">联系人</td>
						<td><input type="text" class="input95" placeholder="联系人" value="{{.info.person}}" name="person"></td>
						<td class="genre">手机号码</td>
						<td><input type="text" class="input95" placeholder="手机号码" value="{{.info.mobile}}" name="mobile"></td>
					</tr>
					<!-- <tr>
						<td class="genre">用户名</td>
						<td colspan="3"><input type="text" class="input95" placeholder="用户名" value="{{.info.username}}" name="username"></td>
						<td class="genre">密码</td>
						<td colspan="3"><input type="password" class="input95" placeholder="密码" value="{{.info.password}}" name="password"></td>
					</tr> -->
					<tr>
						<td class="genre">图片</td>
						<td colspan="7">
							<div class="thumbnail">
								<dl><dt><img src="{{if .info.pathname}}{{.info.pathname}}{{else}}/static/img/admin/uppic.png{{end}}" class="uppic"><input type="file" onchange="uppic(this,'shop')" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
									<input type="hidden" name="logo" value="{{.info.logo}}"></dt><dd>logo</dd><dd class="del_img">删除图片</dd></dl>
								<dl><dt><img src="{{index .imgs 0}}" class="uppic"><input type="file" onchange="uppic(this,'shop')" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
									<input type="hidden" name="companyimg" value="{{index .picnum 0}}"></dt><dd>轮播图 X1</dd><dd class="del_img">删除图片</dd></dl>
								<dl><dt><img src="{{index .imgs 1}}" class="uppic"><input type="file" onchange="uppic(this,'shop')" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
									<input type="hidden" name="companyimg" value="{{index .picnum 1}}"></dt><dd>轮播图 X2</dd><dd class="del_img">删除图片</dd></dl>
								<dl><dt><img src="{{index .imgs 2}}" class="uppic"><input type="file" onchange="uppic(this,'shop')" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
									<input type="hidden" name="companyimg" value="{{index .picnum 2}}"></dt><dd>轮播图 X3</dd><dd class="del_img">删除图片</dd></dl>
								<dl><dt><img src="{{index .imgs 3}}" class="uppic"><input type="file" onchange="uppic(this,'shop')" accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
									<input type="hidden" name="companyimg" value="{{index .picnum 3}}"></dt><dd>轮播图 X4</dd><dd class="del_img">删除图片</dd></dl>
							</div>
						</td>
					</tr>
					<tr>
						<td class="genre">客服热线</td>
						<td colspan="2">
							<input type="text" class="input95" placeholder="请输入客服热线！" name="customservice" class="tel" value="{{.info.customservice}}">
						</td>
						<td class="genre">投诉热线</td>
						<td colspan="2">
							<input type="text" class="input95" placeholder="请输入投诉热线！"  name="complaints" value="{{.info.complaints}}">
						</td>
						<td class="genre">工作时间</td>
						<td colspan="2">
							<input type="text" class="input95" placeholder="请输入工作时间！"  name="workingTime" value="{{.info.workingTime}}">
						</td>
					</tr>
					<tr>
						<td class="genre">客服咨询</td>
						<td><input type="text" class="input95" placeholder="腾讯QQ" value="{{.info.qq}}" name="qq"></td>
						<td class="genre">邮箱</td>
						<td><input type="text" class="input95" placeholder="请输入邮箱！" name="mail" value="{{.info.mail}}"></td>
						<td class="genre">电话号码</td>
						<td><input type="text" class="input95" placeholder="电话号码" value="{{.info.tel}}" name="tel"></td>
						<td class="genre">传真</td>
						<td><input type="text" class="input95" placeholder="传真" value="{{.info.fax}}" name="fax"></td>
					</tr> 
					<tr>
						<td class="genre">微信号</td>
						<td><input type="text" class="input95" placeholder="微信号" value="{{.info.wechat}}" name="wechat"></td>
						<td class="genre">邮编号码</td>
						<td><input type="text" class="input95" placeholder="邮编号码" value="{{.info.postcode}}" name="postcode"></td>
						<td class="genre">网址</td>
						<td><input type="text" class="input95" placeholder="网址" value="{{.info.url}}" name="url"></td>
						<td class="genre">公司人数</td>
						<td><input type="text" class="input95" placeholder="公司人数" value="{{.info.number}}" name="number"></td>
					</tr>
					<tr>
						<td colspan="8">
							<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=pZNN8yCbWXBezCgGpnKMQi283dFLAVGO"></script>
							<div class="map">
								<div class="mapcontent" id="allmap"></div>
							</div>
						</td>
					</tr>
					<tr>
						<td class="genre">地址</td>
						<td colspan="3">
							<input type="text" class="input95" placeholder="请输入地址！" name="address"  id="address" value="{{.info.address}}">
						</td>
						<td class="genre">坐标</td>
						<td colspan="3">
							<input type="text" class="input95" placeholder="点击地图选取坐标！"  name="coordinate" value="{{.info.coordinate}}" >
						</td>
					</tr>
					<tr>
						<td class="genre">运费</td>
						<td colspan="7">
							<input type="number" name="freight" class="input95" value="{{.info.freight}}" placeholder="请输入一立方米运费,运费与新品同步后的零售价相关">
						</td>
					</tr>
					<tr>
						<td class="genre">公司介绍</td>
						<td colspan="7">
							<textarea placeholder="请输入公司介绍，200字内。" class="textarea95" name="profile">{{.info.profile}}</textarea>
						</td>
					</tr>
				<input type="hidden" name="id" value="{{.info.id}}">
			</form>
				<tr class="trbutton">
						<td colspan="2"><button type="button" class="button">保存</button></td>
						<td colspan="6">
							<p>
								<i class="iconfont">&#xe649;</i> 请检查内容确认发布的内容没有涉及传播谣言、政治话题或违反广告法夸大宣传产品等。
							</p>
							<div class="help">帮助
								<div class="help_qr"><img src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/all/qr-code.jpg" alt=""></div>
							</div>
						</td>
					</tr>
			</table>
		</div>
	</article>
</section>

<footer><!-- 系统监控内容 --></footer>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/jquery.jedate.min.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/toast.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/uppic.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/xcConfirm.js"></script>
<script src="https://tcsc.oss-cn-hangzhou.aliyuncs.com/static/admin/js/app.js"></script>
<script>
    // 百度地图API功能
    var map = new BMap.Map("allmap");
    var coor=[121.363158,28.5921]
    {{if .info}}
    var coors={{.info.coordinate}}
    coors=coors.split(",")
    coor[0]=coors[0]
    coor[1]=coors[1]
    {{end}}
    var point = new BMap.Point(coor[0],coor[1]);
    map.centerAndZoom(point, 15);
    var marker = new BMap.Marker(point);  // 创建标注
    map.addOverlay(marker);               // 将标注添加到地图中
    marker.setAnimation(BMAP_ANIMATION_BOUNCE); //跳动的动画
    var local = new BMap.LocalSearch(map, {
        renderOptions:{map: map}
    });
    $('#address').change(function() {
        var xyz=$(this).val()
        local.search(xyz);
    });
    map.addEventListener("click",function(e){
        $('input[name="coordinate"]').val(e.point.lng + "," + e.point.lat);
    });
</script>
<script>
	$("input[name=update]").jeDate({
	    isinitVal:false,
	    festival: false,
	    isToday:true, 
	    format: 'YYYY-MM-DD'
	});
	$('.button').click(function(){
		if (!$('input[name="name"]').val()){
			window.wxc.xcConfirm("请输入名称","info"); return false;
		}
		if (!$('input[name="uid"]').val()){
			window.wxc.xcConfirm("请选择所属用户","info"); return false;
		}
		if (!$('input[name="person"]').val()){
			window.wxc.xcConfirm("请输入联系人","info"); return false;
		}
		if (!$('input[name="mobile"]').val()){
			window.wxc.xcConfirm("请输入手机号码","info"); return false;
		}
		if (!$('input[name="tel"]').val()){
			window.wxc.xcConfirm("请输入电话号码","info"); return false;
		}
		if (!$('input[name="address"]').val()){
			window.wxc.xcConfirm("请输入地址","info"); return false;
		}
		if (!$('input[name="coordinate"]').val()){
			window.wxc.xcConfirm("请点击地图获取坐标","info"); return false;
		}
		var form=$('form').serialize()
		$.ajax({
			url:window.location.href,
			data:form,
			type:'post',
			success:function(res){
				if(res==1){
					 window.wxc.xcConfirm("保存成功","success",{onClose:function(){
                        window.location.href = document.referrer
                    }})
				}else {
					 window.wxc.xcConfirm("保存失败,请重试!","error")
				}
			}
		})
	});
</script>
</body>
</html>
